#pragma once

#include "log/sinks/log_sink_base.h"
#include "helper/file_helper.h"

namespace xlog {

/**
 * @brief 日志文件接收器
 */
template<typename Mutex>
class log_sink_file : public log_sink_base
{
public:
    log_sink_file(const filename_t &filename);
public:
    const filename_t& filename() const;
protected:
    virtual void sink_it(log_msg msg) override;
    
    virtual void flush_it() override;

private:
    file_helper m_file_hlp;
};

}

#ifdef XLOG_HEADER_ONLY
#include "log_sink_file_inl.h"
#endif